package com.wt.springboot.controller;

import com.wt.springboot.bean.Department;
import com.wt.springboot.model.ResponseResult;
import com.wt.springboot.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IDEA
 * Describe:
 * Author:TianJi
 * Date:2018/11/16
 * Time:20:25
 */
@RestController
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @GetMapping("/dept/{id}")
    public ResponseResult getDeptById(@PathVariable("id")Integer id){
        Department department = departmentService.getDeptById(id);
        return ResponseResult.build(0,"success",department);
    }
}
